package com.exp.service;

import com.exp.dao.UserMapper;
import com.exp.dao.more.MoreUserMapper;
import com.exp.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by guojianyu on 2015/9/11.
 */
@Service
@Transactional
public class UserService {
    @Autowired
    private MoreUserMapper moreUserMapper;
    @Autowired
    private UserMapper userMapper;

    public List<User> getList(Map<String, Object> params) {
        return moreUserMapper.getList(params);
    }
    public  int delete(Integer id){
        return  userMapper.deleteByPrimaryKey(id);
    }
    public int add(User user){
        return  userMapper.insert(user);
    }
    public int update(User user){
        return  userMapper.updateByPrimaryKeySelective(user);
    }
    /*用户登录*/
    public List<User> userLogin(Map map){
        List list=moreUserMapper.userLogin(map);
     return list;
    }
}
